<#if hasModule>
package ${customParentPackage}.other;
<#else >
package ${package.Parent}.other;
</#if>

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class MvcConfig implements WebMvcConfigurer {
    @Value("${r'${spring.application.name}'}")
    private String applicationName;

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        /**
         * 控制器添加统一前缀
         */
        configurer.addPathPrefix(applicationName, c -> c.getPackage().getName().startsWith("${package.Parent}"));
    }
}
